﻿// Inner Fire 游戏引擎库
// MapSetting 地图设置
//
// Copyright (c) 2025 by 尔西大帝. All rights reserved.
//
// 所属层级：应用层(4)
// 用于地图的配置，各种代码代表的意义
//
// Author: 尔西大帝
// Email: 2670613871@qq.com
// Created: 2025-06-14

#pragma once

#include <game/config/config_info.h>
#include <xml_reader.h>
#include <element.h>
#include <EASTL/vector.h>


namespace ifire::game {
class ConfigManager;

struct TerrainSetting{
  ikit::sstr name;
  IVec2 tex;
  int code;

  TerrainSetting();
  TerrainSetting(const ikit::XmlNode& node);
};

class MapSetting : public ConfigInfo {
public:
  MapSetting(ConfigManager* manager, const ikit::XmlNode& node);
  MapSetting(const MapSetting& lhs) = delete;
  MapSetting& operator=(const MapSetting& lhs) = delete;
  ~MapSetting();

  const TerrainSetting& GetTerrain(int code) const;

public:
  ikit::str_element terrain_model;
  int sea_level;

private:
  eastl::vector<TerrainSetting> terrains_;
};

using MapSettingPtr = std::unique_ptr<MapSetting>;

} // namespace ifire::game